Skip to content

Apply the GGUF's suppress tokens in the WebGPU TTS sampler - #211

Merged
leehack merged 1 commit into
mainfrom
fix/tts-suppress-tokens
Nov 7, 2026
Merged

leehack merged 1 commit into
mainfrom
fix/tts-suppress-tokens

Conversation

@leehack

@leehack leehack commented Nov 7, 2026

Copy link
Copy Markdown
Owner

Fixes #210

What: The TTS talker sampler now puts a -inf logit bias for llama_vocab_get_suppress_tokens first in its chain, as upstream common_sampler and llamadart-native#180 do.

Why: Qwen3-TTS lists its codec control tokens there; a sampled one fails synthesis with code out of range. Chatterbox Turbo needs the bias to produce audio.

Test: tests/bridge/tts_sampler_suppress_tokens_test.mjs (static contract, like the other src/ contract tests; the bridge has no native test harness) checks the bias is built from the vocab's suppress tokens, uses -INFINITY, and is added before top_k. Mutant: reverting src/llama_webgpu_tts.cpp fails both tests (2 fail, 0 pass). With the fix, npm run check:js and npm test pass (602 pass, 0 fail). The pinned llama.cpp v0.5.0 exposes llama_vocab_get_suppress_tokens.

Not run: wasm build and TTS browser smoke (large model artifacts; left to CI).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Apply the GGUF's suppress tokens in the WebGPU TTS sampler

1 participant